package com.dx_society.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;

import lombok.Data;

/**
 * 社团成员关系表
 *
 * @TableName dx_societies_member
 */
@TableName(value = "dx_societies_member")
@Data
public class SocietiesMember implements Serializable {
    /**
     *
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     *
     */
    private Long societiesId;

    /**
     *
     */
    private String societiesName;

    /**
     *
     */
    private Long userId;

    /**
     * 用户名称
     */
    private String username;

    /**
     * 审核状态（0申请中，1已加入）
     */
    private Integer state;

    /**
     * 入部原因
     */
    private String joinReason;

    /**
     * 退部原因
     */
    private String leaveReason;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        SocietiesMember other = (SocietiesMember) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
                && (this.getSocietiesId() == null ? other.getSocietiesId() == null : this.getSocietiesId().equals(other.getSocietiesId()))
                && (this.getSocietiesName() == null ? other.getSocietiesName() == null : this.getSocietiesName().equals(other.getSocietiesName()))
                && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
                && (this.getUsername() == null ? other.getUsername() == null : this.getUsername().equals(other.getUsername()))
                && (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState()))
                && (this.getJoinReason() == null ? other.getJoinReason() == null : this.getJoinReason().equals(other.getJoinReason()))
                && (this.getLeaveReason() == null ? other.getLeaveReason() == null : this.getLeaveReason().equals(other.getLeaveReason()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getSocietiesId() == null) ? 0 : getSocietiesId().hashCode());
        result = prime * result + ((getSocietiesName() == null) ? 0 : getSocietiesName().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getUsername() == null) ? 0 : getUsername().hashCode());
        result = prime * result + ((getState() == null) ? 0 : getState().hashCode());
        result = prime * result + ((getJoinReason() == null) ? 0 : getJoinReason().hashCode());
        result = prime * result + ((getLeaveReason() == null) ? 0 : getLeaveReason().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", societiesId=").append(societiesId);
        sb.append(", societiesName=").append(societiesName);
        sb.append(", userId=").append(userId);
        sb.append(", username=").append(username);
        sb.append(", state=").append(state);
        sb.append(", joinReason=").append(joinReason);
        sb.append(", leaveReason=").append(leaveReason);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}